package com.zjt.smart.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.zjt.smart.R;
import com.zjt.smart.app.MainApplication;
import com.zjt.smart.ui.activity.test.BaiduImageGridActivity;
import com.zjt.smart.ui.activity.test.BaiduImageListActivity;
import com.zjt.smart.ui.activity.test.BaiduImageStaggerActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {

    @Bind(R.id.toolbar)
    Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);
        MainApplication.mApp.onLaunchApp();
        initToolbar();
    }

    private void initToolbar(){
        toolbar.setTitle("Smart");
    }

    @Override
    protected void onDestroy() {
        ButterKnife.unbind(this);
        super.onDestroy();
    }

    @OnClick({R.id.tv_image_list, R.id.tv_image_grid, R.id.tv_image_stagger})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_image_list:
                startActivity(new Intent(this, BaiduImageListActivity.class));
                break;
            case R.id.tv_image_grid:
                startActivity(new Intent(this, BaiduImageGridActivity.class));
                break;
            case R.id.tv_image_stagger:
                startActivity(new Intent(this, BaiduImageStaggerActivity.class));
                break;
        }
    }
}
